# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : test.py
# @Time     : 2024/2/28 20:41
# @Author   : Robot-Zsj
"""
description: 
"""
string = "  123  "


def func(s):
    i = 0
    start = s[i]
    while start == ' ':
        i += 1
        start = s[i]
    return s[i:]


def solution(S):
    S = func(S)
    S = func(S[::-1])
    return S[::-1]


